Open
Conversation
yurii-litvinov
suggested changes
Jun 1, 2022
Comment on lines
1
to
2
| namespace Game; | ||
| using System; |
There was a problem hiding this comment.
Suggested change
| namespace Game; | |
| using System; | |
| namespace Game; | |
| | |
| using System; |
| namespace Game; | ||
| using System; | ||
|
|
||
| public class EventLoop |
Game/Game/Game/EventLoop.cs
Outdated
Comment on lines
13
to
14
| // Magic 68 and 4 are the coordinates of the point you need to reach in order to win | ||
| while (Console.GetCursorPosition() != (68, 4)) |
There was a problem hiding this comment.
Это часть игровой логики, про которую EventLoop как раз не имеет права знать
| private int currentPositionOnY; | ||
| private readonly string[] map; | ||
|
|
||
| public Game(int initialPositionOnX, int initialPositionOnY, string pathToFile, Action <int, int> action) |
There was a problem hiding this comment.
Suggested change
| public Game(int initialPositionOnX, int initialPositionOnY, string pathToFile, Action <int, int> action) | |
| public Game(int initialPositionOnX, int initialPositionOnY, string pathToFile, Action<int, int> action) |
Game/Game/Game/Game.cs
Outdated
|
|
||
| public class Game | ||
| { | ||
| private readonly Action<int, int> action; |
There was a problem hiding this comment.
Это далеко не лучшее имя поля и параметра конструктора. action что? :)
Game/Game/Game/Game.cs
Outdated
| private static void DrawCharacter() | ||
| { | ||
| Console.WriteLine("@"); | ||
| } |
Game/Game/Game/Game.cs
Outdated
|
|
||
| private static bool IsWall(char x) => x == '|' || x == '+' || x == '-' || x == '_'; | ||
|
|
||
| public void Move(Func<int, int, (int, int)> func) |
There was a problem hiding this comment.
Тут тоже, стоило бы именовать функцию так, чтобы это как-то отражало её назначение
Game/Game/Game/Game.cs
Outdated
Comment on lines
58
to
61
| public void OnLeft(object? sender, EventArgs args) | ||
| { | ||
| Move((x, y) => (x - 1, y)); | ||
| } |
There was a problem hiding this comment.
Suggested change
| public void OnLeft(object? sender, EventArgs args) | |
| { | |
| Move((x, y) => (x - 1, y)); | |
| } | |
| public void OnLeft(object? sender, EventArgs args) | |
| => Move((x, y) => (x - 1, y)); |
Это просто делегация, так что даже по смыслу надо писать через =>
Game/Game/Game/Program.cs
Outdated
Comment on lines
3
to
6
| public class Program | ||
| { | ||
| static void Main(string[] args) | ||
| { |
There was a problem hiding this comment.
Это ненужный с появлением topp-level-операторов код
Comment on lines
121
to
126
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.